429bdf0989703c3eae6976660406460021b401ad,gateway/src/main/java/com/continuuity/gateway/router/RouterServiceLookup.java,RouterServiceLookup,getDiscoverable,#number#HttpRequest#,78
Before Change
return null;
}
String path = httpRequest.getUri();
String host = httpRequest.getHeader(HttpHeaders.Names.HOST);
String httpMethod = httpRequest.getMethod().getName();
final HeaderDecoder.HeaderInfo headerInfo = new HeaderDecoder.HeaderInfo(path, host, httpMethod);
if (headerInfo == null) {
LOG.debug("Cannot find host header for service {} on port {}", service, port);
After Change
}
// Normalize the path once and strip off any query string. Just keep the URI path.
String path = URI.create(httpRequest.getUri()).normalize().getPath();
String host = httpRequest.getHeader(HttpHeaders.Names.HOST);
if (host == null) {
LOG.debug("Cannot find host header for service {} on port {}", service, port);
return null;
}
try {
String destService = routerPathLookup.getRoutingPath(path, httpRequest);
CacheKey cacheKey = new CacheKey(destService == null ? service : destService, host, path);
LOG.trace("Request was routed from {} to: {}", path, cacheKey.getService());
return discoverableCache.get(cacheKey);